The invention pertains to digital data processing and, more particularly, to improved methods for tracing and analyzing calls issued by a computer program. The invention has application, for example, in analyzing usage of a graphics library by an applications program.
Computers have long been used to generate graphical images. Though early computer systems were capable of imaging in only two dimensions, they found ready acceptance in automated drafting, cartography, and the like. By the mid-1970's, three-dimensional graphics systems became commercially available. The systems tended to be quite expensive, requiring dedicated hardware and custom software.
Over the years standardized graphical programming interfaces and libraries have become readily available in the marketplace. Applications programs can now be written to generate three-dimensional images by calling subroutines (or functions), provided in industry-standard graphics libraries, such as those complying with the "OpenGL" specification. The relative ease with which three-dimensional graphics can be generated has led to a proliferation of applications, e.g., for business, technical and scientific simulation, user interfaces, and animation.
Though three-dimensional objects are sometimes shown as "wire-frame" images (in which only the edges of the objects are drawn), it is increasingly common to render all visible surfaces. A standard technique for drawing such "solid body" images is to graphically construct their surfaces from simple geometric shapes, such as lines, triangles, squares and other polyhedrons. An image of a desk, for example, may be rendered by drawing tens or hundreds of thousands of small line segments and triangles, placed side-by-side and individually textured to represent corresponding surfaces of the actual desk. Though graphics libraries have greatly simplified this task, the rendering of a solid body image can require thousands or millions of calls to a library.
Call tracing, a conventional technique for analyzing how an applications program utilizes a library, involves tracking all calls made by the program to the library. Computer programmers typically use call tracing to debug programs that are not functioning in the expected manner. The technique is also used in determining which subroutines in a library are used most often. This can aid in tuning or optimizing the applications program or the library itself.
Call tracing is usually accomplished by modifying the applications program source code to display or print a message as each call is made. Alternatively, it is accomplished by executing the program under the control of a debugger that automatically provides such notification at designated breakpoints.
While call tracing can be effective for many computer programs, it has traditionally been of little value in graphics applications. Even when the calls made to the graphics library can be identified, their sheer number makes analysis virtually impossible. This is compounded by the fact that many graphics calls refer to arrays and other data structures that while, individually, may not be large, in sum, amount to a large quantity of data.
An object of this invention is to provide improved methods for digital data processing and, more particularly, improved methods for analyzing calls issued by a computer program.
A still more particular object of the invention is to provide improved methods for analyzing usage of a graphics library by an applications program.
Yet another object of the invention is to provide improved methods of call tracing.
A related object of the invention is to provide improved methods of call tracing that facilitate debugging, tuning or optimizing library usage and, particularly, graphics library usage.